package com.jin.webvideo.videoCache.policy.operation;


import com.alibaba.fastjson.JSONObject;

import java.util.Map;

public class EqualOperation implements Operation{
    private Map<String,Object> map = null;
    @Override
    public String getSymbol() {
        return "==";
    }

    @Override
    public boolean compute(Object val, String value) {
        if (OperationUtil.isInt(val) || OperationUtil.isBool(val)){
            return String.valueOf(val).equals(value);
        }
        if (OperationUtil.isStr(val)){
            return String.format("'%s'", val).equals(value);
        }
        return false;
    }
}
